const { Document, Packer, Paragraph, TextRun, HeadingLevel } = require("docx");
module.exports = {
    generateDocTemplate: (title) => {
      const doc = new Document({
        styles: {
          paragraphStyles: [{
            id: "procedureStyle",
            name: "操作步骤",
            basedOn: "Normal",
            quickFormat: true,
            run: { size: 22 }
          }]
        },
        sections: [{
          properties: { titlePage: true },
          children: [
            new Paragraph({
              text: title,
              heading: HeadingLevel.HEADING_1,
              alignment: "center"
            })
          ]
        }]
      });
  
      return Packer.toBuffer(doc);
    }
  };